import subprocess

def run_otool_command():
    # 执行 otool 命令
    command = ["otool", "-v", "-s", "__DATA", "__objc_classlist", "/Users/srliu/Desktop/BuildTestApp.app/BuildTestApp"]  # 将 /path/to/your/executable 替换为你的可执行文件的路径
    try:
        result = subprocess.run(command, capture_output=True, text=True, check=True)
        # 检查命令是否成功执行
        if result.returncode == 0:
            # 输出命令执行结果
            print("Command output:")
            print(result.stdout)
        else:
            print("Command failed with return code:", result.returncode)
            print("Error message:", result.stderr)
    except subprocess.CalledProcessError as e:
        print("Error:", e)

# 执行函数
run_otool_command()
